#include "UrlReader.h"

namespace great_config {
	UrlReader::UrlReader(const string &config) : Reader(config), _url(config) {
	}

	UrlReader::~UrlReader () {
	}

	map<string, string> &UrlReader::getConfig(map<string, string> &map) {
		CURL *curl = curl_easy_init();
		CURLcode res;
		curl_easy_setopt(curl, CURLOPT_URL, _url.c_str());
		curl_easy_setopt(curl, CURLOPT_TIMEOUT, 10);
		res = curl_easy_perform(curl);
		curl_easy_cleanup(curl);

		map.clear();

		if(res == CURLE_OK) {

		}
		return map;
	}

}
